package httpSession

import (
	"github.com/astaxie/session"
	_ "github.com/astaxie/session/providers/memory"
	"net/http"
)

var globalSessions *session.Manager

func GetSession(rw http.ResponseWriter, r *http.Request) (session session.Session) {
	sess := globalSessions.SessionStart(rw, r)
	return sess
}

func init() {
	globalSessions, _ = session.NewManager("memory", "gosessionid", 3600)
	go globalSessions.GC()
}
